<?php
	require_once($_SERVER["DOCUMENT_ROOT"]."/global.php");
	require_once($_SERVER["DOCUMENT_ROOT"]."/modules/security_mod.php");
	require_once($_SERVER["DOCUMENT_ROOT"]."/modules/level_mod.php");

	SecurityMod::login();

	$level = $_SESSION["account"]->getLevel();
	if ($level != 'Admin')
		SecurityMod::logout();

	$acc = AccountMod::getAccount(v($_REQUEST, "name"));

	AccountMod::updatePid($acc->getName(), v($_REQUEST, "pid"));

	header('location: accounts.php');
?>
